//
//  AboutUsViewController.m
//  XYMaterial
//
//  Created by 肖扬 on 16/1/11.
//  Copyright © 2016年 肖扬. All rights reserved.
//

#import "AboutUsViewController.h"
#import "EGOImageView.h"
@interface AboutUsViewController ()<UITextFieldDelegate>

@end

@implementation AboutUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.leftBtn addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside];
    if ([self.title isEqualToString:@"关注微信"]) {
        [self drawWeiChat];
    }else if ([self.title isEqualToString:@"关于我们"]){
        [self drawUs];
    }
    // Do any additional setup after loading the view.
}
-(void)drawWeiChat{
//    UIImageView *imageV = [self createImageViewFrame:CGRectMake((SWIDTH - 72)/2, 138, 72, 72) image:nil imageName:@"72_72.png" tag:0];
//    [self.view addSubview:imageV];
    UILabel *youcai = [self createLabelFrame:CGRectMake((SWIDTH - 50)/2, 190, 50, 20) title:@"有材网" titleColor:BLUEColor tag:0];
    youcai.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:youcai];
    
    UILabel *titleLab = [self createLabelFrame:CGRectMake(0, 220, SWIDTH, 15) title:@"更受欢迎的板材交易中心" titleColor:UIColorFromRGB(0x666666) tag:0];
    titleLab.textAlignment = NSTextAlignmentCenter;
    titleLab.font = [UIFont systemFontOfSize:15];
    [self.view addSubview:titleLab];
    
    EGOImageView *tempSmallImg = [[EGOImageView alloc]initWithPlaceholderImage:[UIImage imageNamed:@"默认加载图片"]];
    tempSmallImg.frame = CGRectMake((SWIDTH - 174)/2, 245, 174, 174);
    [tempSmallImg setImageURL:[NSURL URLWithString:[appStatus shareAppStatus].weixin_pic]];
    tempSmallImg.backgroundColor = [UIColor clearColor];
    [tempSmallImg setContentMode:UIViewContentModeScaleAspectFill];
    [self.view addSubview:tempSmallImg];
    
    UILabel *versionLab = [self createLabelFrame:CGRectMake(0, 439, SWIDTH, 20) title:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] titleColor:GRAYColor tag:0];
    versionLab.textAlignment = NSTextAlignmentCenter;
    versionLab.font =[UIFont systemFontOfSize:14];
    [self.view addSubview:versionLab];
    
//    [self drawDownView];
}
-(void)inputClick:(UIButton *)sender{
    //TODO:评价
}
-(void)drawUs{
    UIImageView *imageV = [self createImageViewFrame:CGRectMake((SWIDTH - 72)/2, 138, 72, 72) image:nil imageName:@"72_72.png" tag:0];
    [self.view addSubview:imageV];
    UILabel *titleLab = [self createLabelFrame:CGRectMake(0, 220, SWIDTH, 15) title:@"更受欢迎的板材交易中心" titleColor:UIColorFromRGB(0x666666) tag:0];
    titleLab.textAlignment = NSTextAlignmentCenter;
    titleLab.font = [UIFont systemFontOfSize:15];
    [self.view addSubview:titleLab];
    UILabel *versionLab = [self createLabelFrame:CGRectMake(0, 245, SWIDTH, 20) title:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] titleColor:GRAYColor tag:0];
    versionLab.textAlignment = NSTextAlignmentCenter;
    versionLab.font =[UIFont systemFontOfSize:14];
    [self.view addSubview:versionLab];
    
    UILabel *lab3 = [self createLabelFrame:CGRectMake(10, 15, SWIDTH - 20, 13) title:@"去评价一下" titleColor:[UIColor blackColor] tag:0];
    lab3.font = [UIFont systemFontOfSize:13];
    [self.view addSubview:lab3];
    
    [self drawDownView];
}
-(void)drawDownView{
    UILabel *lab4 = [self createLabelFrame:CGRectMake(5, SHEIGHT - 35, SWIDTH/2 - 10, 20) title:@"官方网站：17youcai.com" titleColor:[UIColor blackColor] tag:0];
    lab4.textAlignment = NSTextAlignmentCenter;
    lab4.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:lab4];
    
    UILabel *lab5 = [self createLabelFrame:CGRectMake(SWIDTH/2, SHEIGHT - 35, 70, 20) title:@"服务电话：" titleColor:[UIColor blackColor] tag:0];
    lab5.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:lab5];
    
    UILabel *lab6 = [self createLabelFrame:CGRectMake(SWIDTH/2+70, SHEIGHT - 35, SWIDTH - 20, 20) title:@"010-53519988" titleColor:UIColorFromRGB(0x2578c3) tag:0];
    lab6.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:lab6];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
